Optimal. Leaf size=69 \[ -\frac {2 i a \sqrt {c-i d} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f}+\frac {2 i a \sqrt {c+d \tan (e+f x)}}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3609, 3618, 65,
214} \begin {gather*} \frac {2 i a \sqrt {c+d \tan (e+f x)}}{f}-\frac {2 i a \sqrt {c-i d} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 214
Rule 3609
Rule 3618
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x)) \sqrt {c+d \tan (e+f x)} \, dx &=\frac {2 i a \sqrt {c+d \tan (e+f x)}}{f}+\int \frac {a (c-i d)+a (i c+d) \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx\\ &=\frac {2 i a \sqrt {c+d \tan (e+f x)}}{f}+\frac {\left (i a^2 (c-i d)^2\right ) \text {Subst}\left (\int \frac {1}{\left (a^2 (i c+d)^2+a (c-i d) x\right ) \sqrt {c+\frac {d x}{a (i c+d)}}} \, dx,x,a (i c+d) \tan (e+f x)\right )}{f}\\ &=\frac {2 i a \sqrt {c+d \tan (e+f x)}}{f}-\frac {\left (2 a^3 (c-i d)^3\right ) \text {Subst}\left (\int \frac {1}{-\frac {a^2 c (c-i d) (i c+d)}{d}+a^2 (i c+d)^2+\frac {a^2 (c-i d) (i c+d) x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{d f}\\ &=-\frac {2 i a \sqrt {c-i d} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f}+\frac {2 i a \sqrt {c+d \tan (e+f x)}}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.22, size = 88, normalized size = 1.28 \begin {gather*} \frac {2 i a \left (-\sqrt {c-i d} \tanh ^{-1}\left (\frac {\sqrt {c-\frac {i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}}{\sqrt {c-i d}}\right )+\sqrt {c+d \tan (e+f x)}\right )}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 684 vs. \(2 (57 ) = 114\).
time = 0.29, size = 685, normalized size = 9.93
method | result | size |
derivativedivides | \(\frac {a \left (2 i \sqrt {c +d \tan \left (f x +e \right )}+\frac {-\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \ln \left (\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-d \tan \left (f x +e \right )-c -\sqrt {c^{2}+d^{2}}\right )+\frac {4 \left (2 i \sqrt {c^{2}+d^{2}}\, c +2 i c^{2}+2 i d^{2}+\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-2 \sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{4 \sqrt {c^{2}+d^{2}}+4 c}+\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \ln \left (d \tan \left (f x +e \right )+c +\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )+\frac {4 \left (-2 i \sqrt {c^{2}+d^{2}}\, c -2 i c^{2}-2 i d^{2}-\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{4 \sqrt {c^{2}+d^{2}}+4 c}\right )}{f}\) | \(685\) |
default | \(\frac {a \left (2 i \sqrt {c +d \tan \left (f x +e \right )}+\frac {-\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \ln \left (\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-d \tan \left (f x +e \right )-c -\sqrt {c^{2}+d^{2}}\right )+\frac {4 \left (2 i \sqrt {c^{2}+d^{2}}\, c +2 i c^{2}+2 i d^{2}+\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-2 \sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{4 \sqrt {c^{2}+d^{2}}+4 c}+\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \ln \left (d \tan \left (f x +e \right )+c +\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )+\frac {4 \left (-2 i \sqrt {c^{2}+d^{2}}\, c -2 i c^{2}-2 i d^{2}-\frac {\left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{4 \sqrt {c^{2}+d^{2}}+4 c}\right )}{f}\) | \(685\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 4714 vs. \(2 (55) = 110\).
time = 0.70, size = 4714, normalized size = 68.32 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 318 vs. \(2 (55) = 110\).
time = 0.91, size = 318, normalized size = 4.61 \begin {gather*} \frac {f \sqrt {-\frac {a^{2} c - i \, a^{2} d}{f^{2}}} \log \left (\frac {2 \, {\left (a c + {\left (i \, f e^{\left (2 i \, f x + 2 i \, e\right )} + i \, f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {a^{2} c - i \, a^{2} d}{f^{2}}} + {\left (a c - i \, a d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{a}\right ) - f \sqrt {-\frac {a^{2} c - i \, a^{2} d}{f^{2}}} \log \left (\frac {2 \, {\left (a c + {\left (-i \, f e^{\left (2 i \, f x + 2 i \, e\right )} - i \, f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {a^{2} c - i \, a^{2} d}{f^{2}}} + {\left (a c - i \, a d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{a}\right ) + 4 i \, a \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} i a \left (\int \left (- i \sqrt {c + d \tan {\left (e + f x \right )}}\right )\, dx + \int \sqrt {c + d \tan {\left (e + f x \right )}} \tan {\left (e + f x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 185 vs. \(2 (55) = 110\).
time = 0.48, size = 185, normalized size = 2.68 \begin {gather*} \frac {2 i \, \sqrt {d \tan \left (f x + e\right ) + c} a}{f} + \frac {4 \, {\left (i \, a c + a d\right )} \arctan \left (\frac {2 \, {\left (\sqrt {d \tan \left (f x + e\right ) + c} c - \sqrt {c^{2} + d^{2}} \sqrt {d \tan \left (f x + e\right ) + c}\right )}}{c \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} - i \, \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} d - \sqrt {c^{2} + d^{2}} \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}}}\right )}{\sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} f {\left (-\frac {i \, d}{c - \sqrt {c^{2} + d^{2}}} + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.20, size = 854, normalized size = 12.38 \begin {gather*} -2\,\mathrm {atanh}\left (\frac {32\,a^2\,d^4\,\sqrt {-\frac {\sqrt {-a^4\,d^2\,f^4}}{4\,f^4}-\frac {a^2\,c}{4\,f^2}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{\frac {a\,d^4\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f^3}+\frac {a\,c^2\,d^2\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f^3}}+\frac {32\,c\,d^2\,\sqrt {-\frac {\sqrt {-a^4\,d^2\,f^4}}{4\,f^4}-\frac {a^2\,c}{4\,f^2}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-a^4\,d^2\,f^4}}{\frac {a\,d^4\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f}+\frac {a\,c^2\,d^2\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f}}\right )\,\sqrt {-\frac {\sqrt {-a^4\,d^2\,f^4}+a^2\,c\,f^2}{4\,f^4}}+2\,\mathrm {atanh}\left (\frac {32\,a^2\,d^4\,\sqrt {\frac {\sqrt {-a^4\,d^2\,f^4}}{4\,f^4}-\frac {a^2\,c}{4\,f^2}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{\frac {a\,d^4\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f^3}+\frac {a\,c^2\,d^2\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f^3}}-\frac {32\,c\,d^2\,\sqrt {\frac {\sqrt {-a^4\,d^2\,f^4}}{4\,f^4}-\frac {a^2\,c}{4\,f^2}}\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-a^4\,d^2\,f^4}}{\frac {a\,d^4\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f}+\frac {a\,c^2\,d^2\,\sqrt {-a^4\,d^2\,f^4}\,16{}\mathrm {i}}{f}}\right )\,\sqrt {\frac {\sqrt {-a^4\,d^2\,f^4}-a^2\,c\,f^2}{4\,f^4}}-\mathrm {atanh}\left (\frac {f^3\,\left (\frac {16\,\left (a^2\,d^4-a^2\,c^2\,d^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^2}+\frac {16\,c\,d^2\,\left (\sqrt {-a^4\,d^2\,f^4}+a^2\,c\,f^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^4}\right )\,\sqrt {-\frac {\sqrt {-a^4\,d^2\,f^4}+a^2\,c\,f^2}{f^4}}}{16\,\left (a^3\,c^2\,d^3+a^3\,d^5\right )}\right )\,\sqrt {-\frac {\sqrt {-a^4\,d^2\,f^4}+a^2\,c\,f^2}{f^4}}-\mathrm {atanh}\left (\frac {f^3\,\left (\frac {16\,\left (a^2\,d^4-a^2\,c^2\,d^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^2}-\frac {16\,c\,d^2\,\left (\sqrt {-a^4\,d^2\,f^4}-a^2\,c\,f^2\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{f^4}\right )\,\sqrt {\frac {\sqrt {-a^4\,d^2\,f^4}-a^2\,c\,f^2}{f^4}}}{16\,\left (a^3\,c^2\,d^3+a^3\,d^5\right )}\right )\,\sqrt {\frac {\sqrt {-a^4\,d^2\,f^4}-a^2\,c\,f^2}{f^4}}+\frac {a\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,2{}\mathrm {i}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________